package com.yst.feign1.feign;

import com.yst.feign1.config.CustomizedConfiguration;
import com.yst.feign1.util.FallbackCreateImpl;
import com.yst.feign1.common.ApiResponse;
import com.yst.feign1.vo.TestVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

@FeignClient(value = "feign2", fallbackFactory = TestFeign.TestFeignFallback.class, configuration = CustomizedConfiguration.class)
public interface TestFeign {

    @GetMapping("/demo/hello")
    ApiResponse<TestVO> testFeign();

//    @GetMapping("/demo/throwException")
//    TestVO throwException();

    @Component
    class TestFeignFallback implements FallbackCreateImpl<TestFeign>{}
}
